<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">

<TITLE>SFX commands: SetupCode</TITLE>
<link href="style.css" rel="stylesheet" type="text/css">
</HEAD>

<BODY>

<P class="title"><A NAME="HELPSFXSetupCode"></A>SFX commands: SetupCode<hr></P>


<P><B><I>SetupCode[=Param]</I></B></P>

<P>If this command is present, SFX archive waits until a program specified
in <A HREF="HELPSFXSetup.htm">Setup</A> or <A HREF="HELPSFXPresetup.htm">Presetup</A>
command finishes and uses its exit code as the exit code of SFX executable.</P>

<P>If SFX failed to run a setup program because of some error,
it returns its own error codes, which are the same as
<a href="HELPExitCodes.htm">WinRAR exit codes</a>.</P>

<p>Since a setup program and SFX module can use same exit code values to
define various events, this command allows to map codes to different areas.</p>

<p>If <i>Param</i> is a positive integer, it is added to setup program codes.
SFX own codes are returned as is.</p>

<p>If <i>Param</i> is a negative integer, its absolute value is added to
SFX own codes. Setup program codes are returned as is.</p>

<p>If <i>Param</i> is 0, both SFX and setup codes are returned as is.</p>

<p>If param is omitted, 1000 is assumed, so "SetupCode" and "SetupCode=1000"
are equal.</p>

<p>Let's suppose we have "SetupCode=1000" command. If SFX failed to run
a setup program, SFX will return its own error code less than 1000,
such as 3 for checksum error. If SFX successfully started a setup program
and it is completed with zero code, SFX will return 1000. If setup program
returned 10, SFX will return 1010.</p>

<p>If we have the negative integer "SetupCode=-1000" command, SFX will return
1003 in case of checksum error, 0 for setup program returning 0 and 10
for setup returning 10.</p>

<P>If several Setup and Presetup commands are used and SetupCode is present,
SFX will wait for every Setup and Presetup command and return a largest code
returned by setup applications.</P>

<h1>Example</h1>

<p class="sample">Setup=setup.exe</p>
<p class="sample">SetupCode</p>


</BODY>
</HTML>
